Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 3 - Geometric Styles / Geometric Styles Reference
Functions / Getting and Setting Style Attributes


GXSetShapeStyleAttributes

You can use the GXSetShapeStyleAttributes function to alter the style attributes of the style object associated with a particular shape.

void GXSetShapeStyleAttributes(gxShape target, 
                               gxStyleAttribute attributes);
target
A reference to the shape whose style attributes you want to alter.
attributes

The new set of attributes.
DESCRIPTION
The GXSetShapeStyleAttributes function sets the style attributes of the style object associated with the shape specified by the target parameter.

If the target shape shares its style object with other shapes, this function makes a copy of the style object, sets the target shape to reference the copy, and changes the style attributes of the copy. (However, if the effect of this function would leave the style attributes unchanged, this function does not create a copy of the style object; instead, it posts a notice).

You can use this function in combination with the GXGetShapeStyleAttributes function to set or clear single style attributes. For example, to clear the gxSourceGridStyle attribute of a style object associated with a target shape, you could use this line of code:

GXSetShapeStyleAttributes(target,
         GXGetShapeStyleAttributes(target & ~gxSourceGridStyle);
To set the gxSourceGridStyle attribute, you could use this line of code:

GXSetShapeStyleAttributes(target,
           GXGetShapeStyleAttributes(target | gxSourceGridStyle);
ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
style_is_nil 
inconsistent_parameters(debugging version)
parameter_out_of_range(debugging version)
Notices (debugging version) 
attributes_already_set 
SEE ALSO
For a discussion of style attributes, see "Style Attributes" on page 3-98.

For an example of pen placement, see "Manipulating Pen Width and Placement" on page 3-51.

For an example of constraining shapes to grids, see "Constraining Shape Geometries to Grids" on page 3-40 and "Constraining Shapes to Device Grids" on page 3-42.

To examine the style attributes of a style object associated with a particular shape, use the GXGetShapeStyleAttributes function, which is described on page 3-112.

To examine the style attributes of a style object, use the GXGetStyleAttributes function, which is described on page 3-109. To alter the style attributes of a style object, use the GXSetStyleAttributes function, which is described on page 3-110.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help